package com.course.controller;


import com.course.service.ICampusCourseService;
import com.course.service.ISubCampusCourseService;
import com.security.anno.IgnoreController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 大忽悠
 * @create 2022/9/15 11:09
 */
@Validated
@RestController
@RequestMapping("/sdk")
@RequiredArgsConstructor
@Api(tags="sdk请求")
@IgnoreController
public class SdkController {
    private final ICampusCourseService iCampusCourseService;
    private final ISubCampusCourseService iSubCampusCourseService;

    @ApiOperation("主校区下是否存在对应的课程")
    @PostMapping("existCourseUnderCampus")
    public Boolean existCourseUnderCampus(@RequestParam("campusId")Integer campusId){
        return iCampusCourseService.existCourseUnderCampus(campusId);
    }

    @ApiOperation("分校区下是否存在对应的课程")
    @PostMapping("existCourseUnderSubCampus")
    public Boolean existCourseUnderSubCampus(@RequestParam("subCampusId")Integer subCampusId){
        return iSubCampusCourseService.existCourseUnderSubCampus(subCampusId);
    }
}
